<?php
    include($_SERVER['DOCUMENT_ROOT']."/ObstacleWebApp/view/header.php");
?>

<section>
<hgroup>
<h1>Tekst aanpassen</h1>
</hgroup>

<form  name="probleemform" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<?php
if(!isset($_POST['Submit']))
{    
$query1 = "SELECT * FROM screeningitem WHERE Id = ".$_GET['itemid']."";
$result1 = mysql_query($query1) or die (mysql_error());
while ($row1 = mysql_fetch_array($result1))
{
    echo "<textarea name=\"comment\" cols=\"0\" rows=\"10\">".$row1['Comment']."</textarea>";
}



?>
    <br><br>
<input type="submit" name="Submit" value="Opslaan">
            <input type="hidden" name="itemid" value="<?php echo $_GET['itemid'] ?>" />
            <input type="hidden" name="screeningid" value="<?php echo $_GET['screeningid'] ?>" />
<input type="button" value="Terug" onclick="javascript:history.back();" />
    
</table>
</form>
    
<?php }
else
{
    mysql_query("UPDATE screeningitem SET Comment='".$_POST['comment']."' WHERE Id=".$_POST['itemid']."");
    echo "De tekst is aangepast.<br>";
    echo "Klik <a href=\"".$cfg['basepath']."controller/screening/screening.php?id=".$_POST['screeningid']."\">hier</a> om terug te gaan naar het overzicht.";
}
?>
    
    
</section>

<?php
    include($_SERVER['DOCUMENT_ROOT']."/ObstacleWebApp/view/footer.php");
?>
